package com.example.java_chatroom.model;

import com.example.java_chatroom.utils.DateUtils;
import lombok.Data;

import java.util.Date;

@Data
public class MessageResponse {
    private String type;
    private int fromId;
    private String fromName;
    private int sessionId;
    private String content;
    private Date postTime;

    public String getPostTime() {
        if(postTime == null) {
            return null;
        }
        return DateUtils.dateFormat(postTime);
    }
}
